const state = {
  active: '',
  loading: false
}

const mutations = {
  SET_ACTIVE: (state, active) => {
    state.active = active
    sessionStorage.setItem('active', active)
  },
  showLoading(state) {
    state.loading = true
  },
  hideLoading(state) {
    state.loading = false
  }
}
const actions = {
  setActive: ({ commit }, active) => {
    commit('SET_ACTIVE', active)
  }
}

export default {
  namespaced: true,
  state,
  mutations,
  actions
}
